import { PATHS } from "@/constants/path"
import { useModalSlideUp } from "@/features/useModal"
import { useLoginAction } from "@/features/useSearchAction"
import { PageHeader } from "@/pages/AccountPage/components/PageHeader"
import styled from "@emotion/styled"
import { memo } from "react"
import { useMatch } from "react-router-dom"

const Privacy = ({ formUrl }: { formUrl: string }) => {
    const { openModalToStep } = useLoginAction()
    const { close } = useModalSlideUp()
    const match_LOGIN = useMatch(PATHS.LOGIN)
    const onBack = async () => {
        await close()
        if (match_LOGIN) return
        if (formUrl === "homeLogin") {
            openModalToStep("login-otp-1")
        } else if (formUrl === "login") {
            openModalToStep("login-otp-1")
        }
        if (formUrl === "homeLoginPassword") {
            openModalToStep("login-password")
        } else if (formUrl === "loginPassword") {
            openModalToStep("login-password")
        }
    }

    return (
        <Root>
            <PageHeader
                title="Privacy Policy"
                textColor={"#0f0f10"}
                iconType="black-arrow"
                onBack={onBack}
                backgroundColor="transparent"
            />
            <ContentBox>
                <LineBackground />
                <RadialBackground />
                <BodyBox>
                    <Title>Privacy</Title>
                    <Content>
                        FILBET.com is committed to protecting your personal information and created
                        this Privacy Policy to let you know what information collected when you use
                        our services at our online sites.This also align with the guidelines under
                        the Data Privacy Act 2012. Please also note that this Privacy Policy will be
                        agreed between you and the BFILBET.com as defined in the Terms and
                        Conditions.
                    </Content>
                    <Title>Information Collected</Title>
                    <Content>
                        Personal data (or personal information) means any information about an
                        individual from which that person can be identified. It does not include
                        data where the identity has been removed (anonymous data).
                    </Content>
                    <Content>
                        We may collect, use, store and transfer different kinds of personal data
                        about you which we have grouped together as follows:
                    </Content>
                    <Content>
                        <ol>
                            <li>
                                Identity Data includes first name, maiden name, last name, username
                                or similar identifier, date of birth and gender.
                            </li>
                            <li>
                                Identification Card which includes facial recognition image and
                                other uploaded photos used for verification.
                            </li>
                            <li>
                                Contact Data includes billing address, delivery address, email
                                address and telephone numbers.
                            </li>
                            <li>Financial Data includes bank account and payment card details.</li>
                            <li>
                                Transaction Data includes details about payments to and from you and
                                other details of products and services you have purchased from us.
                            </li>
                            <li>
                                Technical Data includes internet protocol (IP) address, pc tag, your
                                login data, browser type and version, time zone setting and
                                location, browser plug-in types and versions, operating system and
                                platform and other technology on the devices you use to access this
                                website.
                            </li>
                            <li>
                                Profile Data includes your username and password, purchases or
                                orders made by you, your interests, preferences, correspondence
                                feedback and survey responses.
                            </li>
                            <li>
                                Usage Data includes information about how you use our website,
                                products and services.
                            </li>
                            <li>
                                Marketing and Communications Data includes your preferences in
                                receiving marketing from us and our third parties and your
                                communication preferences
                            </li>
                        </ol>
                    </Content>
                    <Content>
                        We also collect, use and share Aggregated Data such as statistical or
                        demographic data for any purpose. Aggregated Data may be derived from your
                        personal data but is not considered personal data in law as this data does
                        not directly or indirectly reveal your identity. For example, we may
                        aggregate your Usage Data to calculate the percentage of users accessing a
                        specific website feature. However, if we combine or connect Aggregated Data
                        with your personal data so that it can directly or indirectly identify you,
                        we treat the combined data as personal data which will be used in accordance
                        with this privacy policy.
                    </Content>
                    <Title>Data Collection Method</Title>

                    <Content>
                        <div>
                            <b>Identification and Contact Information</b>
                        </div>
                        These may include, but are not limited to, sharing special information,
                        events, offers, and promotions via email, direct mail, social media, phone,
                        SMS, and similar methods.
                    </Content>
                    <Content>
                        <div>
                            <b>Non-marketing Purposes</b>
                        </div>
                        These may include, but are not limited to, validating identity, conducting
                        digital demographic or performance analysis, conducting surveys, handling
                        reservations, purchases, and related transactions, security and
                        surveillance, and in complying with laws and regulatory guidelines.
                    </Content>
                    <Content></Content>
                    <Content>
                        <div>
                            <b>Access</b>
                        </div>
                        You may 'opt out' of receiving any promotional communications either by
                        choosing to opt out where such option is made available on our sites or the
                        service or SMS you receive from us, or at any time by chatting our 24/7 Chat
                        Support directly in our FILBET.com website.
                    </Content>
                    <Title>Information Use</Title>
                    <Content>
                        We will only share your personal data with your permission. Depending on the
                        circumstances, we may share your personal data with the following
                        recipients:
                    </Content>
                    <Content className={"ContentULa"}>
                        <ul>
                            <li>
                                For the purpose of anti-money laundering, fraud detection and/or
                                control, FILBET has the right to transfer your personal data to
                                third parties, including but not limited to third-party suppliers
                                such as the Anti-Money Laundering Commission, PAGCOR, other
                                financial institutions, etc. Integrity Units, Banks, ID and Address
                                Verification System Providers, Payment Service Providers and
                                Financial Institutions, but only if we guarantee that they meet the
                                same standards with regard to data processing and security. We
                                encourage you to read the privacy policies of our third-party
                                suppliers.
                            </li>
                            <li>
                                In addition, we reserve the right to disclose your personal data to
                                relevant third parties, such as groups directly related to Gotech
                                Entertainment, Inc., our regulators,financial integrity units,
                                especially when FILBET has reasonable grounds to suspect that there
                                is a breach in your account behavior.
                            </li>
                            <li>
                                Your data will also be shared with cloud services, data centers,
                                payment services, banks, authentication tools, customer
                                communication tools, game providers, etc. for routine operational
                                purposes.
                            </li>
                            <li>
                                Subject to our regulatory responsibilities, we have the right to
                                share personal information we hold, including personal statistics
                                and/or betting history, with sports organizations to investigate
                                fraud, money laundering or sports integrity issues.
                            </li>
                            <li>
                                We will take all reasonable steps to ensure that your personal data
                                is processed securely, with due care and in compliance with
                                applicable legal requirements.
                            </li>
                        </ul>
                    </Content>
                    <Title>Cookies</Title>
                    <Content>
                        We or our authorized service providers and advertising partners may from
                        time to time use "cookies" or other features to allow us or third parties to
                        collect or share information in connection with your use of our Services or
                        Platform. These features help us improve our Platform and the Services we
                        offer, help us offer new services and features, and/or enable us and our
                        advertising partners to serve more relevant content to you, including
                        through remarketing. “Cookies” are identifiers that are stored on your
                        computer or mobile device that record data about computer or device, how and
                        when the Services or Platform are used or visited, by how many people and
                        other activity within our Platform. We may link cookie information to
                        personal data. Cookies also link to information regarding what web pages you
                        have viewed. This information is used to enable our third party advertising
                        partners to serve advertisements on sites across the internet, and to
                        conduct data analysis and to monitor usage of the Services.
                    </Content>
                    <Content>
                        You may refuse the use of cookies by selecting the appropriate settings on
                        your browser or device. However, please note that if you do this you may not
                        be able to use the full functionality of our Platform or the Services.
                    </Content>
                    <Title>Consent and Obligation</Title>
                    <Content>
                        By using our Website and by providing your personal data, you acknowledge
                        that you are required to provide your actual, accurate and complete data as
                        requested by FILBET.com. Furthermore, you must inform us of any changes to
                        your information so as to ensure it is kept up-to-date and accurate.
                    </Content>
                    <Content>
                        If you are found to be in breach of your obligations or if we have
                        reasonable suspicion that the information you provide is false or incomplete
                        or in any way contrary to Data Privacy Act of 2012 or this Policy, we retain
                        the right to reject your application for registration or to suspend or
                        terminate your account immediately without notice. In this case, you have no
                        right to any compensation due to the rejection of your application, or the
                        suspension or termination of your account.
                    </Content>
                    <Content>
                        By clicking 'I agree' during the registration process or by your continued
                        use of the Service following the posting of this Privacy Policy (as
                        applicable), you agree to this Privacy Policy. This is our entire and
                        exclusive Privacy Policy which should be read in conjunction with Our Terms
                        and Conditions and any additional applicable terms posted on our online
                        sites.
                    </Content>
                    <Title>Questions and Other Concerns? Contact Us</Title>
                    <Content>
                        FILBET.com is available 24/7! Reach us through; Live Chat - Reach out to us
                        by clicking the customer chat support widget on the bottom right corner of
                        the page, and get a fast response.
                    </Content>
                </BodyBox>
            </ContentBox>
        </Root>
    )
}

export default memo(Privacy)

const Root = styled.div`
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
`

const LineBackground = styled.div`
    height: 144rem;
    width: 100%;
    position: absolute;
    background:
        linear-gradient(180deg, #ffd6eb 0%, #f8f9fa 100%),
        radial-gradient(
            100% 50% at 100% 0%,
            rgba(255, 71, 133, 0.15) 0%,
            rgba(255, 71, 133, 0) 100%
        );

    z-index: 2;
    top: 0;
`

const RadialBackground = styled.div`
    background: radial-gradient(
        49.87% 100% at 0% 0%,
        rgba(255, 247, 153, 0.5) 0%,
        rgba(255, 246, 153, 0) 100%
    );
    position: absolute;
    top: 0;
    height: 88rem;
    width: 100%;
    z-index: 3;
`

const ContentBox = styled.div`
    flex: 1;
    z-index: 9;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    overflow: scroll;
`

const Title = styled.div`
    vertical-align: middle;
    font-family: "Gilroy", sans-serif;
    font-weight: 500;
    font-size: 16rem;
    line-height: 24rem;
    letter-spacing: 0;
    text-transform: capitalize;
    text-align: left;
    color: #0f0f10;
    padding-left: 8rem;
    position: relative;
    margin-top: 24rem;
    &::before {
        content: "";
        position: absolute;
        top: 3rem;
        left: 2rem;
        height: 16rem;
        width: 2rem;
        background: #fb517b;
    }
`

const BodyBox = styled.div`
    width: 100%;
    flex: 1;
    padding: 0 16rem 50rem;
    z-index: 10;
`

const Content = styled.div`
    margin-top: 12rem;
    width: 100%;
    font-family: "Gilroy", sans-serif;
    font-weight: 400;
    font-size: 14rem;
    line-height: 20rem;
    letter-spacing: 0;
    color: #3e4046;
    & a {
        color: #3e4046;
    }
    & ul {
        padding: 0 0 0 10rem;
    }
    & ol {
        padding: 0 0 0 14rem;
    }
    & li {
        margin-bottom: 5rem;
    }
    &.ContentULa ul {
        padding: 0 0 0 14rem;
        list-style-type: lower-alpha;
    }
    &.ContentULa li {
        margin-bottom: 10rem;
    }
`
